package com.projet.whattowatch.activity;

import java.util.ArrayList;

import com.projet.whattowatch.R;
import com.projet.whattowatch.adapter.MovieAdapter;
import android.app.Activity;
import android.content.Intent;
import android.os.Bundle;
import android.widget.ListView;

public class PostGenreActivity extends Activity
{
	ListView movieList;
	
	final String EXTRA_MOVIE = "movie_name";
	final String EXTRA_MOVIE_URL = "movie_url";
	
	@Override
	protected void onCreate(Bundle savedInstanceState)
	{
		super.onCreate(savedInstanceState);
		setContentView(R.layout.post_genre);
		
		Intent intent = getIntent();

		ArrayList<String> movieName = new ArrayList<String>();
		ArrayList<String> movieUrl = new ArrayList<String>();
		
		if(intent != null)
		{
			movieName = intent.getStringArrayListExtra(EXTRA_MOVIE);
			movieUrl = intent.getStringArrayListExtra(EXTRA_MOVIE_URL);
		}

		MovieAdapter adapter = new MovieAdapter(this, movieName, movieUrl);
		
		movieList = (ListView)findViewById(R.id.postGenreListView);
		movieList.setAdapter(adapter);
	}
}